﻿using Rodunu.Movies.Services.Models.Netflix.Attributes;
using Rodunu.Movies.Services.Models.Netflix.Enums;

namespace Rodunu.Movies.Services.Models.Netflix
{
    public class RentalHistoryItem : Item
    {
        [XPath("/rental_history_item/link[@rel='http://schemas.netflix.com/id']")]
        public Link TitleLink { get; set; }

        [XPath("/rental_history_item/watched_date/updated/text()")]
        public long WatchedDate { get; set; }

        [XPath("/rental_history_item/viewed_timeupdated/text()")]
        public long ViewedTime { get; set; }

        [XPath("/rental_history_item/updated/updated/text()")]
        public long Updated { get; set; }
    
        [XPath("rental_history_item/category[@scheme='http://api.netflix.com/categories/rental_states']/@label")]
        public RentalStates Format { get; set; }

        public override string TitleRef
        {
            get { return TitleLink.Href; }
        }
    }
}
